﻿using Furion.DatabaseAccessor;
using Furion.DistributedIDGenerator;
using Furion.Schedule;
using ST.Torch.WebApi.Core.Entities.System;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ST.Torch.WebApi.Core.Job
{

    /// <summary>
    /// 定时器-测试
    /// </summary>
    public class SearchJob : IJob
    {
        private readonly IServiceScope _serviceScope;
        public SearchJob(IServiceProvider serviceProvider)
        {
            _serviceScope = serviceProvider.CreateScope();
        }
        public async Task ExecuteAsync(JobExecutingContext context, CancellationToken stoppingToken)
        {
            var _repository = _serviceScope.ServiceProvider.GetService<IRepository>();
            List<SYSMenu> fullSiteSearchModels = new List<SYSMenu>();
            //产品型号
            List<SYSMenu> productModels = await _repository.Change<SYSMenu>().Where(x => true, false).ToListAsync();
        }


        public void Dispose()
        {
            _serviceScope?.Dispose();
        }
    }
}

